import request from '@/utils/request'
import {HOST} from '@/constants'
import qs from 'qs'
import da from "element-ui/src/locale/lang/da";

export function getPaperList(data, pageNum, pageSize) {
  return request({
    url: `${HOST}/paper/list`,
    method:'post',
    data: data,
    params:{
      pageNum:pageNum,
      pageSize:pageSize
    }
  })
}

export function updatePaperInfo(data) {
  return request({
    url: `${HOST}/paper/detail/update`,
    method:'post',
    data:data,
  })
}

export function deletePaper(pid) {
  return request({
    url: `${HOST}/paper/delete`,
    method:'post',
    params:{
      pid:pid
    }
  })
}

export function getPaperDetail(data) {
  return request({
    url: `${HOST}/paper/detail/get`,
    method: 'get',
    params:data
  })
}

export function getMethodByPid(data) {
  return request({
    url: `${HOST}/paper/method/get`,
    method: 'get',
    params:data
  })
}

export function deleteMethod(data) {
  return request({
    url: `${HOST}/paper/method/delete`,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addMethod(data) {
  return request({
    url: `${HOST}/paper/method/add`,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getFileListByPid(data) {
  return request({
    url: `${HOST}/paper/file/get`,
    method: 'get',
    params:data
  })
}

export function addFile(data) {
  return request({
    url: `${HOST}/paper/file/add`,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function deleteFile(data) {
  return request({
    url: `${HOST}/paper/file/delete`,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function pushPaperBaseInfo(data) {
  return request({
    url: `${HOST}/paper/base/push`,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function pushPaperPLInfo(data) {
  return request({
    url: `${HOST}/paper/pl/push`,
    method: 'post',
    data
  })
}
